package trend;
/*
 * Matrix.java
 *
 * Created on 07 March 2008, 16:20
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */
import java.util.*;
/**
 *
 * @author Hussein Patwa
 */
@SuppressWarnings("all")
public class Matrix {
    
    Vector data;
    int rowNo;
    int colNo;
    
    /** Creates a new instance of Matrix */
    public Matrix() {
    }
    
    public Matrix(Vector dat){
        data = dat;
        Vector rowV = (Vector)data.get(0);
        rowNo = data.size();
        colNo = rowV.size();
    }
    
    public double get(int row, int col){
        Vector rowV = (Vector)data.get(row);
        Double rtn = (Double)rowV.get(col);
        return rtn.doubleValue();
    }
    
    public int getRowNo(){
        return rowNo;
    }
    
    public int getColNo(){
        return colNo;
    }
    
    public void print(){
        for(int i = 0; i< rowNo;i++){
            for(int j = 0; j< colNo;j++){
                System.out.print(get(i,j)+ " ");
            }
            System.out.println();
        }
    }

    
}
